﻿namespace Example.Diagnostics
{
    using System.ComponentModel;
    using System.Diagnostics;

    [RunInstaller(true)]
    public sealed class ExampleInstaller : PerformanceCounterInstaller
    {
        public ExampleInstaller()
        {
            CategoryName = "Example Category";

            var data = new CounterCreationData(
                "Example counters / sec",
                "The total number example counters per second.",
                PerformanceCounterType.RateOfCountsPerSecond32);
            Counters.Add(data);

            data = new CounterCreationData("Average Example Time", "The average example time.", PerformanceCounterType.AverageTimer32);
            Counters.Add(data);

            data = new CounterCreationData("Average Example Time Base", "The average example time base.", PerformanceCounterType.AverageBase);
            Counters.Add(data);
        }
    }
}